home *** CD-ROM | disk | FTP | other *** search
- float4x4 WorldViewProjection;
- float4x4 ShadowViewProjection;
- float4x4 TextureMatrix;
- float4x4 DecalMatrix;
-
- texture AlphaTexture;
- texture DiffuseTexture;
- texture ShadowTexture;
- texture CloudsTexture;
- texture FogOfWar;
-
- float3 LightDirection = { 0.0f, 0.0f, 0.0f };
- float3 SunColor = { 1., 0.86, .70f };
- float3 Ambient = { 0.24, 0.12, 0.0f };
- float4 DecalColor = { 0., 0., 0., 0. };
- float4 ShadowOffset;
-
- float4 FogScale = { 0.001953125, 0.001953125, 0.001953125, 0.001953125 };
- float4 ZBias = { 0.0, 0.0, 0.0, -0.004 };
-
- float4 CloudUVShift = { 0.0, 0.0, 0.0, 0.0 };
- float4 CloudScale = { 0.01, 0.01, 0.01, 0.01 };
- float4 BlinkFactor = { 0.0, 0.0, 0.0, 0.0 };
-
-
- technique Technique0
- {
- pass Pass0
- {
- Texture[0] = (DiffuseTexture);
- Texture[1] = (ShadowTexture);
- Texture[2] = (FogOfWar);
-
- VertexShaderConstant[0] = <WorldViewProjection>;
- VertexShaderConstant[4] = <ShadowViewProjection>;
- VertexShaderConstant[8] = <TextureMatrix>;
- VertexShaderConstant[19] = <DecalColor>;
- VertexShaderConstant[20] = <DecalMatrix>;
- VertexShaderConstant[26] = <BlinkFactor>;
- VertexShaderConstant[27] = <FogScale>;
- VertexShaderConstant[30] = <LightDirection>;
- VertexShaderConstant[31] = <ZBias>;
- VertexShaderConstant[32] = <SunColor>;
-
- VertexShader =
- decl
- {
- stream 0;
- float v0[3];
- float v3[3];
- float v6[2];
- }
- asm
- {
- vs_1_1
-
- dcl_position v0
- dcl_normal v3
- dcl_texcoord0 v6
-
- m4x4 oPos, v0, c0
- mul r0, v0, c27
- mov oT2.x, r0.x
- mov oT2.y, r0.z
- m4x4 r0, v0, c12
- mov oT0, v6
- dp4 oT1.x, v0, c8
- dp4 oT1.y, v0, c9
- dp3 r0, v3, c30
- mul r0, r0, c32
- mov r0.a, c19.a
- mul oD0, r0, c26
- dp4 r0, v0, c6
- add oT3.x, r0, c31.w
- };
-
- PixelShaderConstant[17] = <Ambient>;
-
- PixelShader =
- asm
- {
- ps_1_4
- def c0, 1, 1, 1, 1
- def c1, 0.0, 0.0, 0.0, 0
-
- dcl t0.xy
- dcl t1.xyzw
- dcl t2.xy
- dcl t3.xy
- dcl v0.rgba
-
- dcl_2d s0
- dcl_2d s1
- dcl_2d s2
-
- texld r10, t1, s1
- sub r9.r, r10.r, t3.x
- mov r1, c1
- cmp r10, r9.r, c0, r1
- texld r1, t0, s0
- mul r0, r10, v0
- mov r0.a, c0.x
- add r0, r0, c17
- texld r2, t2, s2
- mul r0, r2, r0
- mul r0, r1, r0
- mul r0.a, r0.a, v0.a
- mov oC0, r0
- };
- }
- }
-
-
-
- technique Technique1
- {
- pass Pass0
- {
- Texture[0] = (DiffuseTexture);
- Texture[1] = (ShadowTexture);
- Texture[2] = (FogOfWar);
-
- VertexShaderConstant[0] = <WorldViewProjection>;
- VertexShaderConstant[4] = <ShadowViewProjection>;
- VertexShaderConstant[8] = <TextureMatrix>;
- VertexShaderConstant[19] = <DecalColor>;
- VertexShaderConstant[26] = <BlinkFactor>;
- VertexShaderConstant[27] = <FogScale>;
- VertexShaderConstant[30] = <LightDirection>;
- VertexShaderConstant[31] = <ZBias>;
- VertexShaderConstant[32] = <SunColor>;
-
- VertexShader =
- decl
- {
- stream 0;
- float v0[3];
- float v3[3];
- float v6[2];
- }
- asm
- {
- vs_1_1
-
- dcl_position v0
- dcl_normal v3
- dcl_texcoord0 v6
-
- m4x4 oPos, v0, c0
- mul r0, v0, c27
- mov oT2.x, r0.x
- mov oT2.y, r0.z
- mov oT0, v6
- dp4 oT1.x, v0, c8
- dp4 oT1.y, v0, c9
- dp3 r0, v3, c30
- mul r0, r0, c32
- mov r0.a, c19.a
- add oD0, r0, c26
- dp4 r0, v0, c6
- add oT3.x, r0, c31.w
- mul oD0, v6, c26
- dp4 r0, v0, c6
- add oT3.x, r0, c31.w
- };
-
- PixelShaderConstant[0] = <Ambient>;
-
- PixelShader =
- asm
- {
- ps_1_1
- tex t0
- mov r0, t0
- mul r0.a, r0.a, v0.a
- };
- }
- }
-